import Container

data ListAssoc a b = Node a b (ListAssoc a b) | Empty
	deriving Show

instance Container (ListAssoc a b) where

empty = Empty

add x y Leaf = Node x y Leaf
add l@(Node a b xs) x y	|x == a = l
			|x > a = Node a b (add xs x y)
			|otherwise = Node x y l
			
search Empty x = Nothing
search (Node a b xs) x	|x == a = Just b
			|otherwise = search lst x
			
del Empty x = Empty
del (Node a b xs) x	|x == a = xs
			|otherwise = del xs x
			
toListPair Empty = []
toListPair (Node a b xs) = (a,b) : toListPair xs

